﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace WebTempGen
{
    // Represents the color scheme of a webpage. 
    // Color scheme is defined as consisting of
    // 1. the background color(s)
    // 2. the colors for various links
    // 3. the color for fonts (any individual document regions)
    class ColorScheme
    {
        public enum LinkType { Link, Visited, Active, Hover };

        private Int32 id;
        private Color background;
        private Color[] fonts;
        private Dictionary<LinkType, Color> links;
        private float number_of_times;
        private float probability;
        
        public ColorScheme()
        {
            fonts = new Color[10];
            id = -1;
            links = new Dictionary<LinkType, Color>();
        }

        public Color Background
        {
            get { return this.background;  }
            set { this.background = value; }
        }

        public Color[] Fonts
        {
            get { return this.fonts;  }
            set { this.fonts = value; }
        }

        public Dictionary<LinkType, Color> Links
        {
            get { return this.links;  }
            set { this.links = value; }
        }

        public float Number_of_times
        {
            get { return number_of_times; }
            set { number_of_times = value; }
        }

        public float Probability
        {
            get { return probability; }
            set { probability = value; }
        }

        public Int32 Id
        {
            get { return id; }
            set { id = value; }
        }

        public Boolean Equals(ColorScheme cs)
        {
            if (this.Background == cs.Background && this.Fonts[0] == cs.Fonts[0] &&
                this.Links[LinkType.Active] == cs.Links[LinkType.Active] &&
                this.Links[LinkType.Hover] == cs.Links[LinkType.Hover] &&
                this.Links[LinkType.Link] == cs.Links[LinkType.Link] &&
                this.Links[LinkType.Visited] == cs.Links[LinkType.Visited])
                return true;
            else
                return false;
        }
    }
}
